# encoding: utf-8
import random
a = [i for i in 'abcdefghijklmnopqrstuvwxyz']
b = {}
for i in range(100):
    c = '{}{}'.format(a[random.randint(0,25)],a[random.randint(0,25)]) # 这里可以直接random.choice/choices/sample
    if c in b:
        b.update({c:b.get(c)+1}) # 这里直接 b[c] +=1
    else:
        b.setdefault(c,1) # 这里b[c] = 1
b = sorted(b.items(), key = lambda item:item[1],reverse = True) # 这里会应用lambda，不错
for i in range(len(b)):
    print('词组:{}次数{}'.format(b[i][0],b[i][1]))


